﻿#ifndef UIMODBUSBASE_H
#define UIMODBUSBASE_H

#include <QWidget>
#include <shlib/iottypedef.h>

#include <ElaIconButton.h>

class UiModbusBase : public QWidget
{
    Q_OBJECT
public:
    explicit UiModbusBase(enum ESigType type, QWidget *parent = nullptr);

public slots:
    void slotSelectMapChange(const QString& userid, const QString& modelName, const QString& mapid);

    void slotModbusMapSigChange(QString name, ESigType sigtype);

    void slotSaveChange();

    void slotRecoverChange();

signals:

private:
    enum ESigType m_type;

    class UiFieldSearchWidget* m_searchWidget = nullptr;
    class ElaIconButton* m_clearSearchBtn = nullptr;
    class ElaIconButton* m_saveBtn = nullptr;
    class ElaIconButton* m_resaveBtn = nullptr;
    class CFilterModel* m_filterModel = nullptr;
    class ElaTableView* m_view;
    class CTableModel* m_model = nullptr;

    QMap<QString, int> m_changeRows;

    QString m_userid;
    QString m_modelid;
    QString m_mapid;
};

#endif // UIMODBUSBASE_H
